<?php
/**
 * 用户类
 * @author zengnz
 *
 */
class UserAction extends CommonAction
{
	/**
	 * (non-PHPdoc)
	 * @see CommonAction::_initialize()
	 */	
	public function _initialize() {
		$userAuthKey = session(C('USER_AUTH_KEY'));
		$account = session('customer');
		if ( !isset($userAuthKey) || !$userAuthKey || !$account )
			redirect ( PHP_FILE . C ( 'USER_AUTH_GATEWAY' ) );
	}
	
	public function index() {
		
		$this -> redirect('login');
	}
	
	/**
	 * 会员端
	 */
	public function main() {
		$UserLogic = D('User', 'Logic');
		$tipInfo = $UserLogic -> getTipInfo();
		
		$timeArea = $UserLogic -> getTimeArea();
		$uId = $this -> getUid();
		$userBase = $UserLogic -> getUserBaseInfo($uId);
		
		// 积分信息
		$inteInfo = D('Integration', 'Logic') -> getUserIntegration($uId);
		// 资金信息
		$fundsInfo = D('Funds', 'Logic') -> getUserFunds($uId);
		$fundsInfo['amount'] = financeFormat($fundsInfo['amount']);
		
		$this -> assign('userBase', $userBase);
		$this -> assign('tipInfo', $tipInfo);
		$this -> assign('timeArea', $timeArea);
		$this -> assign('inteInfo', $inteInfo);
		$this -> assign('fundsInfo', $fundsInfo);
		
		$this -> assign('action', 'account');
		$this -> display();
	}
	
	/**
	 * 获取用户信息
	 */
	public function getUserInfo() {
		$id = session(C('USER_AUTH_KEY'));
		if ($id) {
			
			
			
		}
	}
	
	/**
	 * 完善用户资料
	 */
	public function complateUserInfo() {
		
		
	}
	
	/**
	 * 积分明细列表
	 */
	public function integrationList() {
		
		
	}
	
	/**
	 * 资金明细列表
	 */
	public function fundsList() {
		
		
	}
	
	
	
}